﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UML2DOC.Controller.Commands;
using System.Windows.Controls;
using System.Collections;

namespace UML2DOC.Adapters
{
    public class AdapterCreateDoc
    {
        private CommandCreateDoc _cmdCreateDoc;
         private IList _selectedDiagrams;

         public AdapterCreateDoc(Button subject, CommandCreateDoc cmdCreateDoc, ListBox diagramList)
        {
            _cmdCreateDoc = cmdCreateDoc;
            _selectedDiagrams = diagramList.SelectedItems;

            subject.Click += new System.Windows.RoutedEventHandler(subject_Click);
        }

         void subject_Click(object sender, System.Windows.RoutedEventArgs e)
         {
             _cmdCreateDoc.Execute(_selectedDiagrams);
         }
    }
}
